<template>
    <div>
        <h2>标题类型添加</h2>
        <table class="table table-bordered">
            <tbody>
                <tr>
                    <td align="right">标题类型添加</td>
                    <td>
                        <input type="text" v-model="queryInfo.Name">
                    </td>
                </tr>

                <tr>
                    <td align="right"></td>
                    <td>
                        <input type="button" value="添加" class="btn btn-primary" @click="add">
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
</template>

<script setup lang="ts">
import {ref,reactive,onMounted} from 'vue'
import axios from 'axios';
import {useRouter,useRoute} from 'vue-router'
const router=useRouter();
const route=useRoute();
import moment from 'moment';

let queryInfo:any=reactive({
  "Name": ""
})
const add=()=>{
    axios({
        method:'post',
        url:'/api/Info/AddType',
        data:queryInfo
    })
    .then(res=>{
        console.log(res);
       if(res.data>0){
        alert('成功');
        router.push('/')
        return;
       }
       else{
        alert('失败');
       }
    })
    .catch(err=>{
        console.log(err);
    })
}
</script>

<style scoped>

</style>